import socket

server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(("localhost", 12345))
server.listen(1)

print("Waiting for connection...")
client, addr = server.accept()
print("Connected to:", addr)

data = client.recv(1024)
print("Received:", data.decode())
client.send(b"Hello from Python!")
client.close()